import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import './styles/common.scss';
import '@/assets/iconfont/iconfont.css';

window.kchValidator?.initSdk({
  baseUrl: 'http://localhost:9000',
  projectName: 'admin',
  /**
   * 这里在这里添加一些额外信息一起上传
   */
  beforeSubmit: (params: BaseObj<any>) => {
    params['account'] = 18178048222; // Global.user.info.account;
  },
});

const app = createApp(App);
app.use(router).mount('#app');

/** 监控vue全局错误 */
app.config.errorHandler = (error) => {
  console.error(error);
  window.kchValidator?.handleGlobalError(error);
};
